<html><head><title>Writing effective Use Case Examples</title>



<meta name="Description" content="Article with a use case example using ebay to display the usage of use cases showing basic flows and alternate flows">
<meta name="Keywords" content="Use Case Example, Effective Use Case, Basic Flow">
<link rel="stylesheet" href="use_case_example_files/style.css" type="text/css">
<style>
.mango {
    margin-bottom: 8px;
    padding-bottom: 11px;
    padding-left: 1px;
    padding-top: 1px;
	width:760px;
}


</style></head><body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr><td style="background-position: right top;" width="50%"><img src="use_case_example_files/spacer.gif"></td>
<td valign="top">
	<table style="width: 650px;" border="0" cellspacing="0">
	<tbody><tr>
	<td colspan="2">
	<a href="http://www.gatherspace.com/index.html"><img src="use_case_example_files/logo_rev_0321.gif" alt="Requirements Software for writing effective use cases" border="0"></a>
	</td>
	<!--<td valign="bottom" align="right" nowrap><font face="verdana" size="1" color="#6699CC">
	<a href="/static/flash/demo2.htm"><img src="http://www.gatherspace.com/static/images/test/demo.gif" alt="Free Use Case Tool" border=0></a>&nbsp;

	<a href="/security/createaccount.jsp"><img src="http://www.gatherspace.com/static/images/test/free_trial_orange.gif" alt="Free Use Case Tool" border=0></a>
	</td>-->
	</tr>
	</tbody></table>
<table border="0" cellpadding="0" cellspacing="0" width="650">
<tbody><tr>
<td align="left" valign="top">
<br>


<table style="border: 1px solid rgb(221, 221, 221); background-color: rgb(255, 255, 255); width: 650px; border-collapse: collapse;" border="5" cellpadding="2" cellspacing="2">
<tbody><tr>
<td valign="top">
<!-- main body -->

<h1>Writing effective Use Case Examples</h1><p class="text1">
</p><center>
<!-- google add-->
<script type="text/javascript"><!--
google_ad_client = "pub-8496111736520305";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "666666";
google_color_text = "545454";
//--></script>
<script type="text/javascript" src="use_case_example_files/show_ads.js">
</script><iframe name="google_ads_frame" src="use_case_example_files/ads.htm" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" frameborder="0" height="90" scrolling="no" width="728"></iframe>
<!-- end google ad-->
</center>

<br><br>
<h2><a class="underdog" href="http://www.gatherspace.com/static/use_case_example.html#1">STEP 1. When creating use cases, be productive without perfection</a></h2>
<h2><a class="underdog" href="http://www.gatherspace.com/static/use_case_example.html#2">STEP 2. Define your use case actors</a></h2>
<h2><a class="underdog" href="http://www.gatherspace.com/static/use_case_example.html#3">STEP 3. Define your use case Actor Goals</a></h2>
<h2><a class="underdog" href="http://www.gatherspace.com/static/use_case_example.html#4">STEP 4. Identify reuse opportunity for use cases</a></h2>
<h2><a class="underdog" href="http://www.gatherspace.com/static/use_case_example.html#5">STEP 5. Create a use case index</a></h2>
<h2><a class="underdog" href="http://www.gatherspace.com/static/use_case_example.html#6">STEP 6. Identify the key components of your use case</a></h2>
<h2><a class="underdog" href="http://www.gatherspace.com/static/use_case_example.html#7">STEP 7. Name and briefly describe your use case</a></h2>
<h2><a class="underdog" href="http://www.gatherspace.com/static/use_case_example.html#8">STEP 8. Create the use case basic flow</a></h2>
<h2><a class="underdog" href="http://www.gatherspace.com/static/use_case_example.html#9">STEP 9. Create the use case alternate flows</a></h2>
<h2><a class="underdog" href="http://www.gatherspace.com/static/use_case_example.html#10">STEP 10. Product your use case document</a></h2>
<!--<center><a href="/security/createaccount.jsp"><img alt="software requirement specification tool" src="http://www.gatherspace.com/static/images/test/try_it_now_0522.jpg" border=0></a></center>-->
<br>
<table><tbody><tr><td>
<p class="text1">
As I said in the prior section, the best way for writing effective use
cases is to walk through a simple use case example and watch how it can
be leveraged to something complex. By absorbing the meaning of what use
case diagrams, alternate flows and basic flows, you will be able to
apply use cases to your projects.<br><br>
In this section, I'm going to walk you through writing effective use cases for a mock Ebay site. Most of
us know and love Ebay, so if you don't know Ebay, go to Ebay and navigate through the site and come
back to our example. Imagine that only you know Ebay, but nobody has ever seen Ebay and you have to write the requirements
for Ebay using use cases, and explain it to people who have never seen it.<br><br>
</p></td>
<td valign="top">
<!-- google add-->
<script type="text/javascript"><!--
google_ad_client = "pub-8496111736520305";
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = "336x280_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "666666";
google_color_text = "333333";
//--></script>
<script type="text/javascript" src="use_case_example_files/show_ads.js">
</script><iframe name="google_ads_frame" src="use_case_example_files/ads_002.htm" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" frameborder="0" height="280" scrolling="no" width="336"></iframe>
<!-- end google ad-->

</td>

</tr></tbody></table>
<h2><a name="1">STEP 1. To write effective use cases, be productive without perfection</a></h2><p class="text1">
When it comes to writing effective use cases, you
don't need to be a perfectionist and concern yourself with getting it right the first time. Developing
use cases should be looked at as an iterative process where you work and refine. You can always refine it later, so again, don't
go for perfection from the get-go. Loosen up and have some fun while you're doing it.
<br><br>
</p><h2><a name="2">STEP 2. Define your use case actors</a></h2><p class="text1">
There are possibly over a dozen actors that interact with Ebay, from buyers and sellers, down to
suppliers, wholesalers, auditors, and customer service. But we're going for grass-roots, so who are the
basic users of Ebay? BUYERS and SELLERS. So lets put them down as our first actors. (The visual notation in
the figures below is based on UML -- Unified Markup Language for Use Cases)
<br><br>
<img src="use_case_example_files/ebay1.gif" border="0">
<br><br>
Do you notice how the actors aren't John and Sue which would be people? While John may be a seller
and Sue may be a buyer, an actor is a Role. And a role in this case would be that of a buyer and
that of a seller. Now that things are clicking, lets throw some more actors on your paper just so we can try and
identify more possible users.<br><br>
<img src="use_case_example_files/ebay2.gif" border="0">
<br><br>
Now we have a bunch of actors. Wait a minute? Paypal? That's not a
person. An actor can be a system, because a system plays another role
in the context of your
new system and has goals and interacts with other actors as you will
see later.
<br><br>
</p><h2><a name="3">STEP 3. Define your use case Actor Goals</a></h2><p class="text1">
<!-- google add-->
<script type="text/javascript"><!--
google_ad_client = "pub-8496111736520305";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "666666";
google_color_text = "545454";
//--></script>
<script type="text/javascript" src="use_case_example_files/show_ads.js">
</script><iframe name="google_ads_frame" src="use_case_example_files/ads_003.htm" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" frameborder="0" height="90" scrolling="no" width="728"></iframe>
<!-- end google ad-->Now that you have established your actors (system
users), or most of them, the next logical
step is to outline what the goals are of each actor. One you have
established your actors and
the goals of each actor, you have now created your initial list of high
level use cases. In the example below
you will see the representation of actor goals. Again, don't try and
capture 100% of this step, in requirements management, refinement
is always part of the entire process. Effective use cases should have
understandable actors and goals.<br><br>
<img src="use_case_example_files/ebay3.gif" border="0">
<br><br>
</p><h2><a name="4">STEP 4. Identify reuse opportunity for use cases</a></h2><p class="text1">
In this step, you are going to cross the bridge into object modeling. Don't get overly concerned
about terms like generalization, inheritance and extends. The goal of this Ebay use case example is to keep it
understandable so we will explain this concept in terms of the example.
<br><br>
What does the word general mean? Something is broad and not as
detailed. Generalization is when
you "inherit" from something general and then add more detail. A
"person" is very general. A "man" is still general, but not as general
as a "person". You can say that a "man" inherits behavior
and atributes of a "person".
<br><br>Look at the requirements management use case diagram above and
you will see there is duplicate behavior in both the buyer and seller
which includes "create an account" and "search listings". Rather than
have all of this duplication, we will have a more general user that has
this behavior and then the actors will "inherit" this
behavior from the new user.
<br><br>
<img src="use_case_example_files/ebay4.gif" border="0">
<br><br>The above use case example diagram illustrates that a generic
user creates accounts and search listings and that a buyer and a seller
have their own behavior but also have the behavior of the generic user.
The benefits of generalization are that you eliminate duplicate
behavior and attributes that will ultimately make the system more
understandable and flexible. We will see in later steps that this
inheritance applies both to use cases and to the actors.
<br><br>
</p><h2><a name="5">STEP 5. Create a use case index</a></h2><p class="text1">
After producing your initial visual list of use case actors and goals, we can take
this list and create an initial use case grid which provides the basis for the use case
index. Every use case will have various attributes relating both to the use case iteself
and to the project. At the project level, these attributes include scope, complexity, status
and priority.
<br><br>
<img src="use_case_example_files/ebay5.gif" border="0">
<br><br>
This use case index should be used by the project team to define the use cases against. It will
serve as a master inventory to help writ effective use cases for the requirements phase of the project.
<br><br>
</p><h2><a name="6">STEP 6. Identify the key components of your use case</a></h2><p class="text1">
The actual use case is a textual representation illustrating a sequence of events. In our
use case example, you will see that there are several components of a use case which we
will review. In the mean time, review the table below to get a basic understanding of what is in the
use case and then we will review each element as we progeress through our use case example.<br><br>
<!--<img src="/static/images/ebay6.gif" border=2>-->
<br>
</p><center>
<table border="1" cellpadding="1" cellspacing="1" width="600">
<tbody><tr bgcolor="#cfcfcf"><td class="dude">Use Case Element</td><td class="dude">Description</td></tr>
<tr><td class="dude">Use Case Number</td><td class="dude">ID to represent your use case</td></tr>
<tr><td class="dude">Application</td><td class="dude">What system or application does this pertain to</td></tr>
<tr><td class="dude">Use Case Name</td><td class="dude">The name of your use case, keep it short and sweet</td></tr>
<tr><td class="dude">Use Case Description</td><td class="dude">Elaborate more on the name, in paragraph form.</td></tr>
<tr><td class="dude">Primary Actor</td><td class="dude">Who is the main actor that this use case represents</td></tr>
<tr><td class="dude">Precondition</td><td class="dude">What preconditions must be met before this use case can start</td></tr>
<tr><td class="dude">Trigger</td><td class="dude">What event triggers this use case</td></tr>
<tr><td class="dude">Basic Flow</td><td class="dude">The basic flow should be the events of the use case when everything
is perfect; there are no errors, no exceptions. This is the "happy day scenario". The exceptions
will be handled in the "Alternate Flows" section.</td></tr>
<tr><td class="dude">Alternate Flows</td><td class="dude">The most significant alternatives and exceptions</td></tr>
</tbody></table>
</center>
<br><br><p class="text1">
</p><h2><a name="7">STEP 7. Name and briefly describe your use case</a></h2><p class="text1">Now
that you have a general understanding of what a use case consists of,
we are ready to start creating
our use case. Typically, while the name of your use case is being
discussed, people will start briefly describing
the use case. Use plain english and keep it simple. Getting back to our
use case example, I will begin with use case #1 from step number four.
<br><br>
<table border="0" cellpadding="2" cellspacing="2">
<tbody><tr><td class="dude">Use Case Number: </td><td class="dude">1</td></tr>
<tr><td class="dude">Use Case Name:</td><td class="dude">Buyer Places a Bid</td></tr>
<tr><td class="dude">Description:</td><td class="dude">An EBAY buyer has identified an item they wish to buy, so they will place a bid for an item
with the intent of winning the auction and paying for the item.</td></tr>
</tbody></table>
<br><br>
</p><h2>STEP 8. Create the use case basic flow</h2><p class="text1">The
basic flow of a use case represents the most important course of events
or what happens most of the time, sometimes referred to as the 'Happy
Day Scenario' because it is what occurs when everything goes well -- no
errors or exceptions. Another reason why the basic flow is so critical
is because it's much easier to fully comprehend the exceptions once the
norm is understood and if the basic flow represents 70% of the system,
the development staff is much more prone to implementing the correct
code in the first pass.<br><br>
For our use case example, the basic flow should be to describe the
happy day scenario for your use cases such as "placing a bid". For a
consumer
to play a successful bid, what is the primary flow when everything goes
as planned. An effective use cases needs to have the basic flow before
moving forward with writing the alternate flows.
<br><br>
</p><h2><a name="9">STEP 9. Create the use case alternate flows</a></h2><p class="text1">
The basic flow is the key ingredient to your use case and some can argue that you can stop once you're done with the
basic flow. It really depends on the level of detail you wish to achieve. However, providing more detail to the
consumers of your use case is always a good thing.
<br><br>
The alternate flows providing the following:
</p><ul>
<li><p class="text1">An exception or error flow to any line item in your basic flow
</p></li><li>An additional flow, not necessarily error based, but a flow that COULD happen</li>
</ul>
<p class="text1">
A few examples of alternate flows are:
</p><ul>
<li><p class="text1">While a customer places an order, their credit card failed
</p></li><li><p class="text1">While a customer places an order, their user session times out
</p></li><li><p class="text1">While a customer uses an ATM machine, the machine runs out of receipts and needs to warn the customer
</p></li></ul>

<br><br>
<h2><a name="10">STEP 10. Product your effective use case document</a></h2><p class="text1">
Recently at a new project assignment, I introduced a mid level developer to the concept of use cases which was totally foreign
to him. Once walking him through the basic concepts and showing him the use case example, the lightbulb went off in his head
on how convenient and simple it was to grasp the project.<br><br>A
few reasons why it's that much easier to learn a system through use
cases then a traditional requirements document
is probably because with use cases, you are introduced to concepts at a
high level, walk through a living scenario and then presented
with specifications last.
<br><br>In several places in this document, I have stated "effective
use cases" rather than just "use cases". The purpose of the use cases
is for effective knowledge transfer from the domain expert to the
software developer -- these use cases will serve as software
requirements. If they don't make sense to the person building the
software, they are not effective. There are several sources on the web
for writing effective use cases including the book by Alistair
Cockburn.
<!-- end main body -->
</p><p>
<!-- use case report above here -->

<br>
</p></td></tr></tbody></table>
</td></tr></tbody></table>
<div id="footer">
<div class="footer">
<a href="http://www.gatherspace.com/index.html">Home</a> | <a href="http://www.gatherspace.com/static/contactus.html">Contact Us</a> | <a href="http://www.gatherspace.com/static/privacy.html">Privacy Policy</a> | <a href="http://www.gatherspace.com/static/benefits.html">Member Benefits</a> | <a href="http://www.gatherspace.com/static/sitemap.html">Site Map</a><br>
</div>
</div>
</td><td style="background-position: right top;" width="50%"><img src="use_case_example_files/spacer.gif"></td></tr>
</tbody></table><!-- end of first table -->

<script src="use_case_example_files/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-248351-1";
urchinTracker();
</script>
</body></html>